package com.example.customdialog;

import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
        findViewById(R.id.button_dialog).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				CustomDialog.Builder builder = new CustomDialog.Builder(MainActivity.this);  
		        builder.setMessage("这个就是自定义的提示框");  
		        builder.setTitle("提示");  
		        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {  
		            public void onClick(DialogInterface dialog, int which) {  
		                dialog.dismiss();  
		                //设置你的操作事项  
		            }  
		        });  
		  
		        builder.setNegativeButton("取消",  
		                new android.content.DialogInterface.OnClickListener() {  
		                    public void onClick(DialogInterface dialog, int which) {  
		                        dialog.dismiss();  
		                    }  
		                });  
		  
		        builder.create().show();  
			}
		});
		
	}

	

}
